import Vue from 'vue'
import VueRouter from 'vue-router'

import MyGoodsList from '../views/MyGoodsList'
import MyGoodsSearch from '../views/MyGoodsSearch'
import MyUserInfo from '../views/MyUserInfo'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        redirect: '/MyGoodsList'
    },
    {
        path: '/MyGoodsList',
        component: MyGoodsList
    },
    {
        path: '/MyGoodsSearch',
        component: MyGoodsSearch
    },
    {
        path: '/MyUserInfo',
        component: MyUserInfo
    },
]
const router = new VueRouter({
    routes
})
//   防止重点报错
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

export default router
